package org.jwcloud.project.module.zx.taskWarnManagement.service;

import com.jw.mid.mm.comm.common.json.Response;
import com.jw.mid.mm.comm.common.pagination.PageListSlice;
import com.jw.mid.mm.comm.common.pagination.Pagination;

import org.jwcloud.project.module.zx.common.FmtUtil;
import org.jwcloud.project.module.zx.common.Resp;
import org.jwcloud.project.module.zx.common.service.RptUtService;
import org.jwcloud.project.module.zx.taskWarnManagement.service.repository.TaskWarnManagementRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TaskWarnManagementServiceImpl implements TaskWarnManagementService {

    @Autowired
    public TaskWarnManagementRepository taskWarnManagementRepository;

    @Autowired
    public RptUtService rptUtService;

    @Override
    public Resp<Response<PageListSlice>> queryOvertimeWarningList(Pagination pagination, Map param) {
        FmtUtil.pagiBuild(pagination, param);
    	return Resp.success(rptUtService.findPagi(
                pagination,
                param,
                taskWarnManagementRepository.queryOvertimeWarning(param),
                taskWarnManagementRepository.queryOvertimeWarningTotal(param)
        ));
    }
}
